//
//  Student.m
//  OC3_继承练习
//
//  Created by dllo on 15/10/27.
//  Copyright (c) 2015年 dllo. All rights reserved.
//

#import "Student.h"

@implementation Student

- (CGFloat)score
{
    return _score;
}

- (void)setScore:(CGFloat)score
{
    _score = score;
}

- (id)initWithName:(NSString *)name sex:(NSString *)sex age:(NSInteger)age score:(CGFloat)score
{
    self = [super initWithName:name sex:sex age:age];
    if (self) {
        [self setScore:score];
    }
    return self;
}

- (void)info
{
    [super info];
    NSLog(@"%.2f", [self score]);
}

+ (id)studentWithName:(NSString *)name sex:(NSString *)sex age:(NSInteger)age score:(CGFloat)score
{
    Student *stu = [[Student alloc] initWithName:name sex:sex age:age score:score];
    return stu;
}



@end
